<%
if !(posts.class == Array)
  posts = [posts]
end

posts = Post.sort_posts_by_date(posts)

if !posts.nil?
  if posts.size < 10
    @limit = posts.size
  else
    @limit = 10
  end
  @count = 0

  while @count != @limit %>
    <li><%= link_to( (is_sticky(posts[@count ].id) ? "[s] " : "") + posts[@count ].title, "posts/#{posts[@count].id}") %></li>
    <% @count +=1 %>
  <%  end %>

<% else %>
  <li><em>No Posts</em></li>
<% end %>
